<?php
// 数据库连接
$conn = mysqli_connect("localhost", "root", "") or die("数据库链接错误");
mysqli_select_db($conn, "lyb");
// 字符转换，读库
mysqli_query($conn, "set character set 'utf8'");
// 写库
mysqli_query($conn, "set names 'utf8'"); // 使用utf-8中文编码;

function br2nl($text){
    $text=preg_replace('/<br\\s*?\/??>/i',chr(13),$text);
    return preg_replace('/ /i',' ',$text);
}
?>